package com.hello.gateway.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;

import java.util.HashMap;
import java.util.Map;

/**
 * 网关测试控制器
 * 
 * @author hello
 */
@RestController
public class TestController {

    /**
     * 简单测试方法
     */
    @GetMapping("/gateway/test")
    public Mono<Map<String, Object>> test() {
        Map<String, Object> result = new HashMap<>();
        result.put("code", 200);
        result.put("msg", "网关测试接口请求成功1");
        result.put("data", "Hello Gateway Test");
        result.put("time", System.currentTimeMillis());
        
        return Mono.just(result);
    }
    
    /**
     * 健康检查
     */
    @GetMapping("/gateway/health")
    public Mono<String> health() {
        return Mono.just("Gateway Service is running!");
    }
} 